package family.yaongteam.connectlines;

import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;

public class PointInfo {
	private float x;
	private float y;
	private int number;
	private boolean isUse;
	private PointNumberType numberType;
	private float xRatio = 1;
	private float yRatio = 1;
	private Paint paint;
	
	public PointInfo(float x, float y){
		this.x = x;
		this.y = y;
		this.isUse = false;
		this.numberType = PointNumberType.NUMBER;
	}

	public PointNumberType getNumberType() {
		return numberType;
	}

	public void setNumberType(PointNumberType numberType) {
		this.numberType = numberType;
	}	
	public float getX() {
		return x;
	}
	public void setX(float x) {
		this.x = x;
	}
	public float getY() {
		return y;
	}
	public void setY(float y) {
		this.y = y;
	}
	
	
	public float getxRatio() {
		return xRatio;
	}

	public void setxRatio(float xRatio) {
		this.xRatio = xRatio;
		this.x = this.x*this.xRatio;
	}

	public float getyRatio() {
		return yRatio;
	}

	public void setyRatio(float yRatio) {
		this.yRatio = yRatio;
		this.y = this.y*this.yRatio;
	}

	public int getNumber() {
		return number;
	}
	public void setNumber(int number) {
		this.number = number;
	}
	public boolean isUse() {
		return isUse;
	}
	public void setUse(boolean isUse) {
		this.isUse = isUse;
	}
	
	public void draw(Canvas canvas){
		paint = new Paint();
		if(isUse){
			paint.setColor(Color.GREEN);
		}else{
			paint.setColor(Color.BLUE);
		}		
		canvas.drawCircle(x, y, 12, paint);
		
		paint = new Paint();
		paint.setColor(Color.WHITE);
		paint.setAntiAlias(true);
		paint.setTextSize(30);		
		
		String pointCharacter = PointConfig.getPointCharacter(numberType, number);
		canvas.drawText(pointCharacter, x-2, y+2, paint);		
	}
}
